using System.Collections.Generic;
using System.Text;

namespace OracleInternal.SqlAndPlsqlParser.LocalParsing.Ansi
{
	internal class OracleLpTableReferenceAnsiTablePrimary : OracleLpTableReferenceAnsi
	{
		protected OracleLpTablePrimary m_vTablePrimary;

		public override List<OracleLpColumnDescriptor> ColumnDescriptors => m_vTablePrimary.ColumnDescriptors;

		public OracleLpTablePrimary TablePrimary
		{
			get
			{
				return m_vTablePrimary;
			}
			set
			{
				m_vTablePrimary = value;
				if (m_vTablePrimary != null)
				{
					m_vTablePrimary.Parent = this;
				}
			}
		}

		internal override List<OracleLpTablePrimary> TablePrimaryList
		{
			get
			{
				if (m_vTablePrimaryList == null)
				{
					m_vTablePrimaryList = new List<OracleLpTablePrimary>(1);
					m_vTablePrimaryList.Add(m_vTablePrimary);
				}
				return m_vTablePrimaryList;
			}
		}

		public OracleLpTableReferenceAnsiTablePrimary(OracleLpStatementElement se)
			: base(se)
		{
			m_vTableReferenceType = OracleLpTableReferenceAnsiType.TablePrimary;
		}

		internal override void ToString(StringBuilder sb)
		{
			string depthIndent = base.DepthIndent;
			sb.Append(depthIndent);
		}

		public override void RetrieveNamedObjectReferences(OracleLpStatement statement)
		{
			m_vTablePrimary.RetrieveNamedObjectReferences(statement);
		}
	}
}
